const state = {
    // 面包屑数据
    breadData: {},
    userInfo: {},
    tabIndex: '',
}

const getters = {
    // 获取面包屑数据
    breadData: state => {
        return state.breadData ? state.breadData : {}
    },
    userInfo: state => {
        return state.userInfo ? state.userInfo : {}
    },
    tabIndex: state => {
        return state.tabIndex ? state.tabIndex : 0
    },  
}

const mutations = {
    breadData (state, data) {
        state.breadData = data
    },
    userInfo (state, data) {
        state.userInfo = data
    },
    tabIndex (state, data) {
        state.tabIndex = data
    }, 
}

export default {
    state,
    getters,
    mutations,
}